<tagLib name="strends" />
<php>
	function getaimg($img){
		return "<img width='40' height='40' src='/res".$img."'>";
	}
</php>
<include file="Public:header" />
<script type="text/javascript" src="__TMPL__Static/Js/dataList.js"></script>
<div class="handle-btns">
	<strends:imageBtn id="addAdmin" name="addAdmin" value="{%ADD}" click="addData()" />
	<strends:imageBtn id="editAdmin" name="editAdmin" value="{%EDIT}" click="editData(this,'checkList','uid')" />
	<strends:imageBtn id="removeAdmin" name="removeAdmin" value="{%REMOVE}" click="removeUser(this,'checkList')" />
</div>
<strends:list id="checkList" pk='uid' style="list" name="admin" checkbox="true" action="true" datasource="list" 
show="id:{%ID}|80,user_name:{%USER_NAME}|~left,money_num:{%MONEY}|100,up_money:{%UP_MONEY}|60,get_money:{%GET_MONEY}|60,credits:{%CREDITS}|60,create_time|toDate:{%CREATE_TIME}|140,id|changetype:{%TYPE}|100,status|getStatusImg:{%STATUS}|60:toggleStatus|uid" 
actionlist="" action_width="1" />
<div class="pager">{$page}</div>
<script type="text/javascript">
function removeUser(obj,id,pk)
{
	var ids =  new Array();
	
	if(isNaN(id))
	{
		$("#" + id + " input:checked[name='key']").each(function(){
			ids.push(this.value);
		});
	}
	else
	{
		ids.push(id);
		var parent = $(obj).parent().parent();
		id = parent.parent().parent().attr('id');
	}
	
	ids = ids.join(',');
	if(ids == '')
		return false;
	
	if(!window.confirm(CONFIRM_DELETE))
		return false;

	var url = APP + '?' + VAR_MODULE + '=' + CURR_MODULE + '&' + VAR_ACTION + '=remove&id='+ids;
	
	var fun = function(){
		location.href = url;
	};
	
	setTimeout(fun,1);
}
function asktype(id,type){
	$.ajax({
	  url: '/trends/index.php?m=HongMoney&a=asktype&id='+id+'&t='+type,
	  cache: false,
	  dataType:"json",
	  success:function(result)
	  {		
		if(result.status==1){
			
			if(type==1){
				var html = "<span>已同意</span>&nbsp;|&nbsp;<span onclick='asktype("+id+",2)' style='cursor:pointer;'>打款</span>";
				$('.t_'+id).empty();
				$('.t_'+id).append(html);
			}else if(type==2){
				var html = "<span onclick='asktype("+id+",3)' style='cursor:pointer;'>已打款</span>";
				$('.t_'+id).empty();
				$('.t_'+id).append(html);
			}else if(type==3){
				var html = "<span>结束</span>";
				$('.t_'+id).empty();
				$('.t_'+id).append(html);
			}else if(type==4){
				var html = "<span>已驳回</span>";
				$('.t_'+id).empty();
				$('.t_'+id).append(html);
			}
		}else{
			alert('提交失败！');
		}

	  }
	});
}
</script>
<include file="Public:footer" />